{% extends "../templates/ajax/main_content_base.html" %} 
{% block intro %}{% endblock %}
{% block page_name %}edit_settings{% endblock %}
{% block content %}


<div class="content-box">
	<div class="content-box-header">
		<h3>系统设置</h3>
	</div>
	<!-- End .content-box-header -->

	<div class="content-box-content">

		<div class="tab-content default-tab">

			<h4></h4>
			<form id="edit-settings-form" action="edit_settings" method="post">

				<fieldset>
					<!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->

					<p>
						<label>开放注册
						<input class="check-all" name="allow_register" {%if settings.allow_register%}checked{% endif %} type="checkbox" /></label> 
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
					</p>
					<p>
						<label>允许建立小组
						<input class="check-all" name="allow_create_group" {%if settings.allow_create_group%}checked{% endif %} type="checkbox" /></label> 
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
					</p>
					<p>
						<label>允许加入小组
						<input class="check-all" name="allow_join_group" {%if settings.allow_join_group%}checked{% endif %} type="checkbox" /></label> 
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
					</p>
					<p>
						<label>允许退出小组
						<input class="check-all" name="allow_quit_group" {%if settings.allow_quit_group%}checked{% endif %} type="checkbox" /></label> 
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
					</p>
					<p>
						<label>允许解散小组
						<input class="check-all" name="allow_delete_group" {%if settings.allow_delete_group%}checked{% endif %} type="checkbox" /></label> 
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
					</p>
					<p>
						<label>允许更改小组信息
						<input class="check-all" name="allow_edit_group" {%if settings.allow_edit_group%}checked{% endif %} type="checkbox" /></label> 
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
					</p>
					<p>
						<label>小组成员数</label> <input
							class="text-input small-input required digits" type="text" id="number_of_group_member"
							name="number_of_group_member" value="{{settings.number_of_group_member}}" />
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
	
					</p>
					<p>
						<label>每页显示用户数</label> <input
							class="text-input small-input required digits" type="text" id="user_number_per_page"
							name="user_number_per_page" value="{{settings.user_number_per_page}}" />
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
	
					</p>
					<p>
						<label>每页显示小组数</label> <input
							class="text-input small-input required digits" type="text" id="group_number_per_page"
							name="group_number_per_page" value="{{settings.group_number_per_page}}" />
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
	
					</p>
					
					<p>
						<label>每页显示作业数</label> <input
							class="text-input small-input required digits" type="text" id="group_number_per_page"
							name="homework_number_per_page" value="{{settings.homework_number_per_page}}" />
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
	
					</p>
					<p>
						<label>作业部署目录</label> <input
							class="text-input small-input required " type="text" id="root_path_of_homework"
							name="root_path_of_homework" value="{{settings.root_path_of_homework}}" />
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
	
					</p>
					<p>
						<label>作业部署目录访问URL</label> <input
							class="text-input small-input required " type="text" id="url_of_homework"
							name="url_of_homework" value="{{settings.url_of_homework}}" />
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
	
					</p>
					
					<p>
						<label>作业保存目录</label> <input
							class="text-input small-input required " type="text" id="root_path_of_src_file"
							name="root_path_of_src_file"  value="{{settings.root_path_of_src_file}}" />
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
	
					</p>
					<p>
						<label>作业保存目录访问URL</label> <input
							class="text-input small-input required " type="text" id="url_of_src_file"
							name="url_of_src_file"  value="{{settings.url_of_src_file}}" />
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
	
					</p>
					<p>
						<input class="button" type="submit" value="保存设置" />
					</p>

				</fieldset>

				<div class="clear"></div>
				<!-- End .clear -->

			</form>

		</div>
		<!-- End #tab3 -->

	</div>
	<!-- End .content-box-content -->

</div>
<!-- End .content-box -->

<script type="text/javascript" >


$('#edit-settings-form').validate();
$('#edit-settings-form').ajaxForm({
    // dataType identifies the expected content type of the server response
    dataType: 'json',

    // success identifies the function to invoke when the server response
    // has been received
    success:function(json)
    {
    	if(json.error)
    		{
    			
    			Boxy.alert("保存错误，请检查您的信息\n"+json.error_type+json.error, function() {}, {title: '错误'});
    		}
    	else
    		Boxy.alert("设置保存成功", function() {
    			$('#main-content').load('edit_settings')
    		}, {title: '成功'});
    }
});
</script>
{% endblock %}



